package com.tac.controller.mes;

import com.github.pagehelper.PageInfo;
import com.tac.common.result.Result;
import com.tac.pojo.mes.QualityReport;
import com.tac.service.mes.QualityReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@RestController
@CrossOrigin
@Api(tags = "制作执行MES--质量管理--质量报告")
@RequestMapping("/qualityReport")
public class QualityReportController {

    @Autowired
    private QualityReportService qualityReportService;

    //质量报告查询
    @GetMapping("/getList")
    @ApiOperation("质量报告查询")
    public Result<PageInfo<QualityReport>> getList(Integer pageNum, Integer pageSize, String completionOrderNumber, String planNumber, String jobName, String productName, String inspectionLot
            , @DateTimeFormat(pattern = "yyyy-MM-dd") Date manufactureDateStart, @DateTimeFormat(pattern = "yyyy-MM-dd")Date manufactureDateEnd, String inspectionItems){
        return qualityReportService.getList(pageNum, pageSize, completionOrderNumber, planNumber, jobName, productName, inspectionLot, manufactureDateStart, manufactureDateEnd, inspectionItems);
    }
}
